<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>java基础：set接口 | haijd</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  <meta name="keywords" content="Java基础" />
  
  
  
  
  <meta name="description" content="Java种的Set接口">
<meta name="keywords" content="Java基础">
<meta property="og:type" content="article">
<meta property="og:title" content="Java基础：Set接口">
<meta property="og:url" content="http://www.hais2.com/2017/06/16/Java基础：Set接口/index.html">
<meta property="og:site_name" content="haijd">
<meta property="og:description" content="Java种的Set接口">
<meta property="og:locale" content="default">
<meta property="og:image" content="http://img.mp.sohu.com/upload/20170809/7f6678264b154d028f0e36e9159c8e9a.png">
<meta property="og:updated_time" content="2017-12-15T13:36:29.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Java基础：Set接口">
<meta name="twitter:description" content="Java种的Set接口">
<meta name="twitter:image" content="http://img.mp.sohu.com/upload/20170809/7f6678264b154d028f0e36e9159c8e9a.png">
  
    <link rel="alternate" href="/atom.xml" title="haijd" type="application/atom+xml">
  
  <link rel="icon" href="/css/images/favicon.ico">
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link href="https://fonts.googleapis.com/css?family=Open+Sans|Montserrat:700" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic" rel="stylesheet" type="text/css">
  <link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
  <style type="text/css">
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/9749f0/00000000000000000001008f/27/l?subset_id=2&fvd=n5) format("woff2");font-weight:500;font-style:normal;}
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/90cf9f/000000000000000000010091/27/l?subset_id=2&fvd=n7) format("woff2");font-weight:500;font-style:normal;}
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/8a5494/000000000000000000013365/27/l?subset_id=2&fvd=n4) format("woff2");font-weight:lighter;font-style:normal;}
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/d337d8/000000000000000000010095/27/l?subset_id=2&fvd=i4) format("woff2");font-weight:400;font-style:italic;}</style>
    
  <link rel="stylesheet" id="athemes-headings-fonts-css" href="//fonts.googleapis.com/css?family=Yanone+Kaffeesatz%3A200%2C300%2C400%2C700&amp;ver=4.6.1" type="text/css" media="all">
  <link rel="stylesheet" href="/css/style.css">

  <script src="/js/jquery-3.1.1.min.js"></script>

  <!-- Bootstrap core CSS -->
  <link rel="stylesheet" href="/css/bootstrap.css" >
  <link rel="stylesheet" href="/css/hiero.css" >
  <link rel="stylesheet" href="/css/glyphs.css" >
  
    <link rel="stylesheet" href="/css/vdonate.css" >
  

</head>

<script>
var themeMenus = {};

  themeMenus["/"] = "Home"; 

  themeMenus["/archives"] = "Archives"; 

  themeMenus["/categories"] = "Categories"; 

  themeMenus["/tags"] = "Tags"; 

  themeMenus["/about"] = "About"; 

</script>


  <body data-spy="scroll" data-target="#toc" data-offset="50">


  <header id="allheader" class="site-header" role="banner">
  <div class="clearfix container">
      <div class="site-branding">

          <h1 class="site-title">
            
              <a href="/" title="haijd" rel="home"> haijd </a>
            
          </h1>

          
            <div class="site-description">Stay Hungry,Stay Foolish</div>
          
            
          <nav id="main-navigation" class="main-navigation" role="navigation">
            <a class="nav-open">Menu</a>
            <a class="nav-close">Close</a>
            <div class="clearfix sf-menu">

              <ul id="main-nav" class="nmenu sf-js-enabled">
                    
                      <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-1663"> <a class="" href="/">Home</a> </li>
                    
                      <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-1663"> <a class="" href="/archives">Archives</a> </li>
                    
                      <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-1663"> <a class="" href="/categories">Categories</a> </li>
                    
                      <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-1663"> <a class="" href="/tags">Tags</a> </li>
                    
                      <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-1663"> <a class="" href="/about">About</a> </li>
                    
              </ul>
            </div>
          </nav>


      </div>
  </div>
</header>




  <div id="container">
    <div id="wrap">
            
      <div id="content" class="outer">
        
          <section id="main" style="float:none;"><article id="post-Java基础：Set接口" style="width: 66%; float:left;" class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="clearfix post-1016 post type-post status-publish format-standard has-post-thumbnail hentry category-template-2 category-uncategorized tag-codex tag-edge-case tag-featured-image tag-image tag-template">
    
<div class="article-gallery">
  <div class="article-gallery-photos">
    
      <a class="article-gallery-img fancybox" href="http://img.mp.sohu.com/upload/20170809/7f6678264b154d028f0e36e9159c8e9a.png" rel="gallery_cjie4nahx004p3swa7w1fbbeb">
        <img src="http://img.mp.sohu.com/upload/20170809/7f6678264b154d028f0e36e9159c8e9a.png" itemprop="image">
      </a>
    
  </div>
</div>

    
      <header class="article-header">
        
  
    <h1 class="thumb" class="article-title" itemprop="name">
      Java基础：Set接口
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	Posted on <a href="/2017/06/16/Java基础：Set接口/" class="article-date">
	  <time datetime="2017-06-16T15:39:46.000Z" itemprop="datePublished">June 16, 2017</time>
	</a>

      
	<span id="busuanzi_container_page_pv">
	  本文总阅读量<span id="busuanzi_value_page_pv"></span>次
	</span>

    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <!-- TOC -->
<ul>
<li><a href="#set接口">Set接口</a></li>
<li><a href="#实现类hashset的存储和迭代">实现类HashSet的存储和迭代</a></li>
<li><a href="#字符串对象的哈希值">字符串对象的哈希值</a></li>
<li><a href="#hashset的存储过程">HashSet的存储过程</a></li>
<li><a href="#linkedhashset集合">LinkedHashSet集合</a></li>
<li><a href="#arraylisthashset判断对象是否重复">ArrayList,HashSet判断对象是否重复</a></li>
<li><a href="#hashcode和equals方法">hashCode和equals方法</a></li>
</ul>
<!-- /TOC -->
<h3 id="Set接口"><a href="#Set接口" class="headerlink" title="Set接口"></a>Set接口</h3><ul>
<li>Set接口的特点<ul>
<li>Set接口是不能包含重复元素的集合。</li>
<li>Set集合取出元素的方式可以采用：迭代器、foreach。</li>
</ul>
</li>
</ul>
<h3 id="实现类HashSet的存储和迭代"><a href="#实现类HashSet的存储和迭代" class="headerlink" title="实现类HashSet的存储和迭代"></a>实现类HashSet的存储和迭代</h3><ul>
<li>HashSet (哈希表)无序集合,存储和取出的顺序不同,没有索引,不存储重复元素</li>
<li>内部使用的<code>map</code>存储的，添加操作在内部实现是当作map的key存储的，所以不会出现重复元素。 <a id="more"></a>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span></span>&#123;</span><br><span class="line">	Set&lt;String&gt; set=<span class="keyword">new</span> HashSet&lt;String&gt;();</span><br><span class="line">	set.add(<span class="string">"a1"</span>);</span><br><span class="line">	set.add(<span class="string">"a2"</span>);</span><br><span class="line">	set.add(<span class="string">"a3"</span>);</span><br><span class="line">	set.add(<span class="string">"a3"</span>);   <span class="comment">//相同数据会存储失败</span></span><br><span class="line">	Iterator&lt;String&gt; iterator=set.iterator();</span><br><span class="line">	<span class="keyword">while</span> (iterator.hasNext()) &#123;</span><br><span class="line">		System.out.println(iterator.next());  <span class="comment">//输出：a1 a2 a3</span></span><br><span class="line">	&#125;</span><br><span class="line">    <span class="keyword">for</span> (String str : set) &#123;</span><br><span class="line">		System.out.println(str);              <span class="comment">//输出：a1 a2 a3</span></span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="字符串对象的哈希值"><a href="#字符串对象的哈希值" class="headerlink" title="字符串对象的哈希值"></a>字符串对象的哈希值</h3><ul>
<li><p>计算对象的散列值，String类重写了父类Object的hashCode方法</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">     * Returns a hash code for this string. The hash code for a</span></span><br><span class="line"><span class="comment">     * &#123;<span class="doctag">@code</span> String&#125; object is computed as</span></span><br><span class="line"><span class="comment">     * &lt;blockquote&gt;&lt;pre&gt;</span></span><br><span class="line"><span class="comment">     * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]</span></span><br><span class="line"><span class="comment">     * &lt;/pre&gt;&lt;/blockquote&gt;</span></span><br><span class="line"><span class="comment">     * using &#123;<span class="doctag">@code</span> int&#125; arithmetic, where &#123;<span class="doctag">@code</span> s[i]&#125; is the</span></span><br><span class="line"><span class="comment">     * &lt;i&gt;i&lt;/i&gt;th character of the string, &#123;<span class="doctag">@code</span> n&#125; is the length of</span></span><br><span class="line"><span class="comment">     * the string, and &#123;<span class="doctag">@code</span> ^&#125; indicates exponentiation.</span></span><br><span class="line"><span class="comment">     * (The hash value of the empty string is zero.)</span></span><br><span class="line"><span class="comment">     *</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@return</span>  a hash code value for this object.</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">hashCode</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">int</span> h = hash;</span><br><span class="line">        <span class="keyword">if</span> (h == <span class="number">0</span> &amp;&amp; value.length &gt; <span class="number">0</span>) &#123;</span><br><span class="line">            <span class="keyword">char</span> val[] = value;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; value.length; i++) &#123;</span><br><span class="line">                <span class="comment">//val字节数组在这里记录了字符串的所有字符，在计算的时候转成了ASCII码参与运算。</span></span><br><span class="line">                h = <span class="number">31</span> * h + val[i];  </span><br><span class="line">            &#125;</span><br><span class="line">            hash = h;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> h;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>String类重写的hashCode返回一串数字</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">String s1 = <span class="keyword">new</span> String(<span class="string">"abc"</span>);</span><br><span class="line">String s2 = <span class="keyword">new</span> String(<span class="string">"abc"</span>);</span><br><span class="line">System.out.println(s1.hashCode());  <span class="comment">//输出：96354</span></span><br><span class="line">System.out.println(s2.hashCode());  <span class="comment">//输出：96354</span></span><br><span class="line">        </span><br><span class="line">System.out.println(<span class="string">"哈哈"</span>.hashCode());   <span class="comment">//输出：694528</span></span><br><span class="line">System.out.println(<span class="string">"呵呵"</span>.hashCode());   <span class="comment">//输出：691872</span></span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="HashSet的存储过程"><a href="#HashSet的存储过程" class="headerlink" title="HashSet的存储过程"></a>HashSet的存储过程</h3><ol>
<li>首先调用当前数据类型本类的hashCode()方法算出哈希值(自定义类型调用的是Object的方法，也可以自己重写hashCode方法)</li>
<li>在map容器中找是否与新元素哈希值相同的已有元素<ul>
<li>如果没有直接存入</li>
<li>如果有转到第三步</li>
</ul>
</li>
<li>新元素会与该索引位置下的已有元素利用equals方法一一对比<ul>
<li>新元素.equals(已有元素)返回true，则停止对比，说明重复，不再存入</li>
<li>如果与该索引位置下的已有元素都通过equals方法对比返回false,说明没有重复，存入容器</li>
</ul>
</li>
</ol>
<h3 id="LinkedHashSet集合"><a href="#LinkedHashSet集合" class="headerlink" title="LinkedHashSet集合"></a>LinkedHashSet集合</h3><ul>
<li>LinkedHashSet是Set的一个实现，LinkedHashSet继承于HashSet，并且其内部是通过LinkedHashMap来实现的。</li>
<li>LinkedHashSet具有顺序，也就是怎么存进去的怎么拿出来，顺序不会乱。</li>
<li>LinkedHashSet是线程不安全的，也就是说会有两个线程操作同一个LinkedHashSet集合的情况发生。<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">function</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    LinkedHashSet&lt;String&gt; lsh=<span class="keyword">new</span> LinkedHashSet&lt;String&gt;();</span><br><span class="line">    lsh.add(<span class="string">"a1"</span>);</span><br><span class="line">    lsh.add(<span class="string">"a2"</span>);</span><br><span class="line">    lsh.add(<span class="string">"a3"</span>);</span><br><span class="line">    <span class="keyword">for</span> (String string : lsh) &#123;</span><br><span class="line">			System.out.println(string);  <span class="comment">//输出：a1 a2 a3</span></span><br><span class="line">		&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="ArrayList-HashSet判断对象是否重复"><a href="#ArrayList-HashSet判断对象是否重复" class="headerlink" title="ArrayList,HashSet判断对象是否重复"></a>ArrayList,HashSet判断对象是否重复</h3><ul>
<li>ArrayList的contains方法底层依赖于equals方法<ul>
<li>ArrayList的contains方法在执行时，会使用调用方法时传入的元素(类型)的equals方法依次与集合中的已有元素进行比较，根据返回的Boolean值判断是否有重复元素。</li>
<li>当ArrayList存放自定义类型(对象)时，如果自定义类型没有重写equals方法，判断存入的对象是否重复的依据是对象在堆中的地址值，所以如果想根据对象的属性等内容判断是否为重复元素，就应该重写元素的equals方法。</li>
</ul>
</li>
</ul>
<ul>
<li>HashSet的<code>add()</code>方法和<code>contains方法()</code>底层都依赖<code>hashCode()</code>方法与<code>equals()</code>方法<ul>
<li>HashSet集合由于是无序的，其判断唯一的依据是元素类型的<code>hashCode</code>与<code>equals</code>方法的返回结果:<ul>
<li>先判断新元素与集合内已有元素的<code>HashCode</code>值</li>
<li>如果不同，说明是不同元素，添加到集合。</li>
<li>如果相同，再判断equals比较结果。返回true则相同元素；返回false则不同元素，添加到集合。</li>
</ul>
</li>
<li>使用HashSet存储自定义类型，如果没有重写该类的hashCode与equals方法，则判断重复时，使用的是地址值，如果想通过内容比较元素是否相同，需要重写该元素类的<code>hashcode</code>与<code>equals</code>方法。</li>
</ul>
</li>
</ul>
<h3 id="hashCode和equals方法"><a href="#hashCode和equals方法" class="headerlink" title="hashCode和equals方法"></a>hashCode和equals方法</h3><blockquote>
<p><a href="http://www.cnblogs.com/Qian123/p/5703507.html" target="_blank" rel="noopener">推荐阅读</a></p>
</blockquote>

      
    </div>
    <footer class="entry-meta entry-footer">
      
	<span class="ico-folder"></span>
    <a class="article-category-link" href="/categories/Java/">Java</a>

      
  <span class="ico-tags"></span>
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Java基础/">Java基础</a></li></ul>

      
        <div id="donation_div"></div>

<script src="/js/vdonate.js"></script>
<script>
var a = new Donate({
  title: '如果觉得我的文章对您有用，请随意打赏。您的支持将鼓励我继续创作!', // 可选参数，打赏标题
  btnText: 'Donate', // 可选参数，打赏按钮文字
  el: document.getElementById('donation_div'),
  wechatImage: '/css/images/wechatPay.png',
  alipayImage: '/css/images/alipay.jpg'
});
</script>
      

      
        
	<section id="comments" class="comment">
	  <div id="disqus_thread">
	  <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
	  </div>
	</section>

	<script type="text/javascript">
	var disqus_shortname = 'haijdblog';
	(function(){
	  var dsq = document.createElement('script');
	  dsq.type = 'text/javascript';
	  dsq.async = true;
	  dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
	  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
	}());
	(function(){
	  var dsq = document.createElement('script');
	  dsq.type = 'text/javascript';
	  dsq.async = true;
	  dsq.src = '//' + disqus_shortname + '.disqus.com/count.js';
	  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
	}());
	</script>


      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2017/06/20/Java基础：Map接口/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          Java基础：Map接口
        
      </div>
    </a>
  
  
    <a href="/2017/06/14/Java基础：List接口/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Java基础：List接口</div>
    </a>
  
</nav>

  
</article>

<!-- Table of Contents -->

  <aside id="sidebar">
    <div id="toc" class="toc-article">
    <strong class="toc-title">Contents</strong>
    
      <ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Set接口"><span class="nav-number">1.</span> <span class="nav-text">Set接口</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#实现类HashSet的存储和迭代"><span class="nav-number">2.</span> <span class="nav-text">实现类HashSet的存储和迭代</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#字符串对象的哈希值"><span class="nav-number">3.</span> <span class="nav-text">字符串对象的哈希值</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HashSet的存储过程"><span class="nav-number">4.</span> <span class="nav-text">HashSet的存储过程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#LinkedHashSet集合"><span class="nav-number">5.</span> <span class="nav-text">LinkedHashSet集合</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ArrayList-HashSet判断对象是否重复"><span class="nav-number">6.</span> <span class="nav-text">ArrayList,HashSet判断对象是否重复</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hashCode和equals方法"><span class="nav-number">7.</span> <span class="nav-text">hashCode和equals方法</span></a></li></ol>
    
    </div>
  </aside>
</section>
        
      </div>
      <footer id="footer" class="site-footer">
  

  <div class="clearfix container">
      <div class="site-info">
	      &copy; 2018 haijd All Rights Reserved.
          
            <span id="busuanzi_container_site_uv">
              本站访客数<span id="busuanzi_value_site_uv"></span>人次  
              本站总访问量<span id="busuanzi_value_site_pv"></span>次
            </span>
          
      </div>
      <div class="site-credit">
        Theme by <a href="https://github.com/iTimeTraveler/hexo-theme-hiero" target="_blank">hiero</a>
      </div>
  </div>
</footer>


<!-- min height -->

<script>
    var contentdiv = document.getElementById("content");

    contentdiv.style.minHeight = document.body.offsetHeight - document.getElementById("allheader").offsetHeight - document.getElementById("footer").offsetHeight + "px";
</script>
    </div>
    <!-- <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
    <a href="/categories" class="mobile-nav-link">Categories</a>
  
    <a href="/tags" class="mobile-nav-link">Tags</a>
  
    <a href="/about" class="mobile-nav-link">About</a>
  
</nav> -->
    

<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/scripts.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/main.js"></script>








	<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
	</script>






  </div>

  <a id="rocket" href="#top" class=""></a>
  <script type="text/javascript" src="/js/totop.js" async=""></script>
</body>
</html>
